package com.itheima05;

import java.io.*;
import java.net.Socket;
import java.util.Scanner;

public class Tcp05 {
    public static void main(String[] args) throws IOException {

        Socket socket = new Socket("127.0.0.1", 10000);

        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));


        Scanner sc = new Scanner(System.in);
        String line;

        while ((line = sc.nextLine()) != null) {
            if ("over".equals(line)) {
                break;
            }
            writer.write(line);
            writer.newLine();
            writer.flush();
        }

        socket.close();
    }
}
